//
//  NormalView.m
//  海角音乐
//
//  Created by dllo on 15/8/8.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "NormalView.h"



@implementation NormalView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        
        // 下拉放大
        self.imageView_one = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 150)];
        self.imageView_one.image = [UIImage imageNamed:@"online_default_big_logo.jpg"];
        self.imageView_two = [[UIImageView alloc] init];
        self.imageView_two.frame = CGRectMake(0, 0, SCREEN_WIDTH, 150);
        [self.imageView_one addSubview:_imageView_two];
        
        //    // 磨玻璃效果
//        UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
//        self.effectView = [[UIVisualEffectView alloc] initWithEffect:blur];
//        self.effectView.frame = self.imageView_two.frame;
//        [self.imageView_two addSubview:_effectView];
//        [_effectView release];

        self.littleImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80*ADJUSTWIDTH, 80*ADJUSTWIDTH)];
        [self.littleImage setCenter:CGPointMake(self.effectView.frame.size.width/2, self.effectView.frame.size.height/2)];
        self.littleImage.layer.masksToBounds = YES;
        self.littleImage.layer.cornerRadius = 80*ADJUSTWIDTH/0.06;
        [self.effectView addSubview:_littleImage];
        
        
        
        self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-50-64) style:UITableViewStylePlain];
        self.tableView.tableHeaderView = self.imageView_one;
        [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
        [self addSubview:_tableView];
        [_tableView release];
        [_imageView_one release];
        [_imageView_two release];
        

        
                                                
        
    }
    
    return self;
}


- (void)getURLForImage:(NSString *)url textForLabel:(NSString *)text
{
    
    [self.imageView_two sd_setImageWithURL:[NSURL URLWithString:url]
                          placeholderImage:[UIImage imageNamed:@"online_default_big_logo.jpg"]];
    
    [self.littleImage sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@""]];
    
    
    
}
- (void)getLocalImage:(NSString *)imageName
{
    self.imageView_two.image = [UIImage imageNamed:imageName];
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
